<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件的语法糖注册方式</title>
</head>
<script src="../js/vue.js"></script>
<body>

<div id="app">
    <cpn></cpn>
    <cpn2></cpn2>
</div>

</body>

<script>
    // 1，全局组件注册的语法糖
    Vue.component('cpn', {
        template: `
       <div>
       <h1>我是标题</h1>
</div>
       `
    });
    const vue = new Vue({
        'el': '#app',
        'data': {},
        'methods': {},
        // 局部组件的语法糖
        components: {
            'cpn2': {
                template: `
                    <div>大苏打实打实</div>
                `
            }
        }
    })
</script>
</html>